<?php
//反射API
	class Person{
		public $name;
		public $gender;
		public function say(){
			echo $this->name,'is',$this->gender;
		}
	}
	$student=new Person();
	$student->name="Tome";
	$student->gender="male";
	//$student反射对象 属性
	$reflect=new ReflectionObject($student);
	$className=$reflect->getName();
	echo $className;
	$props=$reflect->getProperties();
	foreach($props as $v){
		print $v->getName()."\n";
	}
	var_dump($props);
	$methods=$reflect->getMethods();
	foreach($methods as $method){
		print $method->getName()."\n";
	}
	//不使用反射
//	var_dump(get_object_vars($student)); 
//	print_r($student);
//	$class=get_class($student);
//	var_dump(get_class_vars($class));
//	var_dump(get_class_methods($class));
	//传类名
	$obj=new ReflectionClass('Person');
	$className=$obj->getName();
	echo $className;
